import {
  IsDateString,
  IsInt,
  IsNotEmpty,
  IsOptional,
  IsString,
} from "class-validator";

export class ArticlePublishDTO {
  @IsString()
  @IsOptional()
  cover?: string;

  @IsNotEmpty()
  @IsString()
  readonly title: string;

  @IsString()
  @IsOptional()
  author?: string;
  @IsString()
  @IsOptional()
  author_home_page?: string;

  @IsString()
  @IsOptional()
  readonly sort?: string;

  @IsInt()
  @IsOptional()
  sort_id?: number;

  @IsDateString()
  @IsNotEmpty()
  readonly date: string;

  @IsString()
  @IsNotEmpty()
  readonly content_type: "xml" | "XML" | "markdown" | "MARKDOWN";
  @IsString()
  @IsNotEmpty()
  content: string;
}
